package wzc.design_pattern.creation.singleton;

/**
 * @Author 王振川
 * @Date 2025/7/20
 * @Description 懒汉式创建单例（线程安全 synchronized）
 */

public class LazyInitializationSync {
    private static LazyInitializationSync instance;

    private LazyInitializationSync() {}

    public static synchronized LazyInitializationSync getInstance() {
        if (instance == null) {
            instance = new LazyInitializationSync();
        }
        return instance;
    }
}
